package com.jmxcfc.blfsc.common.common.enums;

/**
 * 接口调用状态
 * @author pbs
 */
public enum ApiStatusEnum {

       //短信终态:成功
    SUCCESS("S","成功"),
    //短信终态:失败
    FAILURE("F","失败"),
    //异常状态
    EXCEPTION("E", "异常");


    /**
     * 状态
     */
    private String status;

    /**
     * 描述
     */
    private String desc;


    ApiStatusEnum(String status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    public String getStatus() {
        return this.status;
    }

    public String getDesc() {
        return this.desc;
    }


    /**
     * 根据值  获取 枚举
     * @param status
     * @return
     */
    public static ApiStatusEnum getEnumByStatus(String status) {
        ApiStatusEnum[] instances = ApiStatusEnum.values();
        for(ApiStatusEnum instance : instances){
            if(instance.getStatus().equals(status)){
                return instance;
            }
        }
        return null;
    }
}
